home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
cross
/
GBDK-2.0.lha
/
GBDK
/
lib
/
printn.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-10-01
|
355b
|
19 lines
#include <stdio.h>
/* Print a number in any radix */
extern char *digits;
void printn(BYTE number, BYTE radix, BYTE signed_value)
{
UBYTE i;
if(number < 0 && signed_value) {
putchar('-');
number = -number;
}
if((i = (UBYTE)number / (UBYTE)radix) != 0)
printn(i, radix, UNSIGNED);
putchar(digits[(UBYTE)number % (UBYTE)radix]);
}